<template>
<template v-if="show">
  <my-tree2-node :tree="tree"></my-tree2-node>
</template>
<my-tree2-item v-for="child in tree.childs" :tree="child"></my-tree2-item>
</template>

<script>
import MyTree2Node from './MyTree2Node.vue'

export default {
  name: 'my-tree2-item',
  props: {
    tree: {
      type: Object
    }
  },
  components: {
    'my-tree2-node': MyTree2Node
  },
  computed: {
    show () {
      let root = this.tree.root
      return root.curr === this.tree
    }
  }
}
</script>

<style>
</style>